Component({
  properties: {
    image: {
      type: String, 
      value: ''
    },
    target: {
      type: String,
      value: ''
    },
    width:{
      type: String,
      value: '70%'
    },
    showClose:{
      type: String,
      value: 'yes'
    },
    openType:{
      type: String,
      value: ''
    },

  },

  data: { // 弹窗显示控制 

    isShow: false
  }, 
  
  methods: {
    /** 
    * 公有方法 
    */
    //隐藏弹框 
    hide() {
      this.setData({
        isShow: false
      })
    },
    //展示弹框 
    show() {
      this.setData({
        isShow: true
      })
    }, 

    _getPhoneNumber(e){
      this.triggerEvent("getphonenumber", e.detail);
    },

    _clickEvent() {
      if (this.properties.target) {
        let first = '/pages/coupon/index,/pages/mall/index,/pages/show/index,/pages/clickMe/index,';
        if (first.indexOf(this.properties.target) != -1) {
          wx.switchTab({
            url: this.properties.target,
          })
        } else {
          wx.navigateTo({
            url: this.properties.target,
          })
        }
        this.hide();
      }else{
        this.triggerEvent("onclick");
      }
    },
    
    _closeEvent() { //触发取消回调 
      this.hide();
    }
  }

})